package test_new;

import junit.framework.Assert;

import org.junit.Test;

public class AbsComparatorTest {
	
	@Test
	public void testCompare() {
		AbsComparator comparator = new AbsComparator(new NaturalOrderComparator());
		Assert.assertEquals(1, comparator.compare(-5, 4));
		Assert.assertEquals(0, comparator.compare(-5, 5));
		Assert.assertEquals(1, comparator.compare(5, -4));
	}
	
	@Test
	public void testCompare2() {
		AbsComparator comparator = new AbsComparator(new ReversOrderComparator());
		Assert.assertEquals(-1, comparator.compare(-5, 4));
		Assert.assertEquals(0, comparator.compare(-5, 5));
		Assert.assertEquals(-1, comparator.compare(5, -4));
	}
	

}
